﻿<?xml version="1.0" encoding="utf-8" ?>
<xs:schema
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  targetNamespace="http://www.codeplex.com/MSSqlSchemaDoc"
  xmlns="http://www.codeplex.com/MSSqlSchemaDoc"
  attributeFormDefault="unqualified"
  elementFormDefault="qualified">

  <xs:complexType name="IndexCollectionType">
    <xs:sequence>
      <xs:element name="Index" minOccurs="0" maxOccurs="unbounded">
        <xs:complexType>
          <xs:sequence>

            <xs:element name="IsUnique" type="xs:boolean" />
            <xs:element name="IgnoreDuplicateKey" type="xs:boolean" />
            <xs:element name="IsPrimaryKey" type="xs:boolean" />
            <xs:element name="IsUniqueConstraint" type="xs:boolean" />
            <xs:element name="FillFactor" type="xs:integer" />
            <xs:element name="IsPadded" type="xs:boolean" />
            <xs:element name="IsDisabled" type="xs:boolean" />
            <xs:element name="IsHypothetical" type="xs:boolean" />
            <xs:element name="AllowRowLocks" type="xs:boolean" />
            <xs:element name="AllowPageLocks" type="xs:boolean" />
            <xs:element name="HasFilter" type="xs:boolean" />
            <xs:element name="FilterDefinition" type="xs:string" />

            <xs:element name="Columns">
              <xs:complexType>
                <xs:sequence>

                  <xs:element name="IndexColumn" maxOccurs="unbounded">
                    <xs:complexType>
                      <xs:sequence>
                        <xs:element name="IsDecendingKey" type="xs:boolean" />
                        <xs:element name="IsIncludedColumn" type="xs:boolean" />
                      </xs:sequence>
                      <xs:attribute name="Name" type="xs:string" />
                    </xs:complexType>
                  </xs:element>

                </xs:sequence>
              </xs:complexType>
            </xs:element>

            </xs:sequence>

          <xs:attribute name="Name" type="xs:string" />
          <xs:attribute name="IndexType" type="xs:string" />
          
        </xs:complexType>
      </xs:element>

    </xs:sequence>    
  </xs:complexType>

</xs:schema>